﻿using System.ComponentModel.DataAnnotations;

namespace TeachlyQBank.Models
{
    public class Answer
    {
        [Required]
        [MaxLength(50)]
        public string ? answer_id { get; set; }  // 答案表的id

        public string ? answer_content { get; set; } // 答案的内容

        [Range(0, 1)]  // 0代表错误,1代表正确
        public short? is_correct { get; set; }  // 是否是正确答案

        [MaxLength(50)]
        public string ? question_id { get; set; }  // 外键,对应问题的id

        public int keyid { get; set; }

        public Question ? question { get; set; } // 存放这个答案对应的问题 
    }

}
